package com.example.memorypoint.activity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.example.memorypoint.R;
import com.kongzue.dialogx.dialogs.BottomMenu;
import com.kongzue.dialogx.dialogs.PopTip;
import com.kongzue.dialogx.interfaces.MenuItemTextInfoInterceptor;
import com.kongzue.dialogx.interfaces.OnIconChangeCallBack;
import com.kongzue.dialogx.interfaces.OnMenuItemClickListener;
import com.kongzue.dialogx.util.TextInfo;
import com.makeramen.roundedimageview.RoundedImageView;

import java.io.File;

public class UserActivity extends AppCompatActivity implements View.OnClickListener {


    private Toolbar toolbar;
    private RelativeLayout rl_chart;
    private RelativeLayout rl_history;
    private RelativeLayout rl_message;
    private RelativeLayout rl_data;

    @SuppressLint("MissingInflatedId")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user);
        toolbar = findViewById(R.id.toolbar);
        rl_chart = findViewById(R.id.rl_chart);
        rl_history = findViewById(R.id.rl_history);
        rl_message = findViewById(R.id.rl_message);
        rl_data = findViewById(R.id.rl_data);
        rl_chart.setOnClickListener(this);
        rl_history.setOnClickListener(this);
        rl_message.setOnClickListener(this);
        rl_data.setOnClickListener(this);
        toolbarBack();

    }

    private void toolbarBack() {
        toolbar.setNavigationOnClickListener(view ->
                finish());
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == android.R.id.home) finish();
        return super.onOptionsItemSelected(item);
    }

    @SuppressLint("NonConstantResourceId")
    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (id == R.id.rl_chart) {
            startActivity(new Intent(this, ChartActivity.class));
        } else if (id == R.id.rl_history) {
            startActivity(new Intent(this, HistoryActivity.class));
        } else if (id == R.id.rl_message) {
            startActivity(new Intent(this, MessageActivity.class));
        } else if (id == R.id.rl_data) {
            startActivity(new Intent(this, DateActivity.class));
        }
    }


}